package com.itheima.day04;

import java.math.BigDecimal;

public class BigdecimalTest {
    public static void main(String[] args) {
        double a = 0.1;
        double b = 0.2;
         String A =Double.toString(a);
         String B =Double.toString(b);
         BigDecimal c = new BigDecimal(A);
         BigDecimal d = new BigDecimal(B);
         System.out.println(c.add(d));
         BigDecimal a1 = BigDecimal.valueOf(a);
         BigDecimal b1 = BigDecimal.valueOf(b);
         System.out.println(a1.add(b1));
         System.out.println(a1.multiply(b1));
         System.out.println(a1.divide(b1));
         System.out.println(a1.subtract(b1));
         double e = a1.add(b1).doubleValue() ;


    }
}
